As communication protocols which are used many times in local area networks (LANS), especially in-vehicle LANs, a CAN (Controller Area Network) protocol corresponding to one of CSMA/CD systems is proposed in this field.
In this CAN protocol, an SOF (Start Of Frame) code indicative of a start of a frame and an identification (ID) code are applied to a head portion of the frame to be used. This ID code is used to identify which message has been allocated to a succeeding data region. That is, each of communication control apparatus installed in network terminals which constitute a LAN recognizes a start of a frame by receiving an SOF code, and identifies a sort of this frame based upon an ID code.
Also, a communication control apparatus having a frame to be transmitted immediately starts to transmit the frame, if a bus is not under use state. To the contrary, when a bus is under use state, this communication control apparatus starts to transmit the frame after the bus is released (that is, transmission of frame is ended). In a case that there are plural sets of communication control apparatus which want to transmit frames, since these communication control apparatuses commence to transmit these frames at the same time when the bus is released, the frames will collide with each other on this bus.
When such a frame collision occurs, in accordance with the CAN protocol, an arbitration control operation is carried out by employing a method called as a “bit unit non-destruction arbitration,” while the arbitration control operation determines that which frame should be processed with a priority by employing the above ID code.
That is, there are a dominant (high priority) and a recessive (low priority) as to signal levels on a bus. In a case that dominants and recessives are transmitted at the same time from a plurality of communication control apparatus, a signal level of the bus becomes dominant. In general, it is so considered that a logic value of a dominant is equal to “0”, whereas a logic value of a recessive is equal to “1.” Then, SOF codes are dominant in all of frames, ID codes are allocated in such a manner that these ID codes do not own the same logic values among plural communication control apparatus, and an MSB is transmitted as a head.
For instance, as shown in FIG. 4, the following case is considered. That is, an ID code is constituted by 4 bits (ID code of actual CAN protocol is constructed of 11 bits). Three sets of first to third communication control apparatuses start to transmit frames at the same time. The ID code applied to a frame transmitted from the first communication control apparatus is 0001B. The ID code applied to a frame transmitted from the second communication control apparatus is 0010B. The ID code applied to a frame transmitted form the third communication control apparatus is 0100B. In this case, when the first second bits in the ID codes are transmitted, the output (second bit of ID code) of the third communication control apparatus is a recessive (1). However, since a signal level of a bus is a dominant (0), it is so assumed at this time that the third communication control apparatus fails in an arbitration. Thus, this third communication control apparatus stops transmission of the frame. The operation of this third communication control apparatus is transferred to a reception condition.
Similarly, when the first third bit in the ID code, subsequent to the above second bit, is transmitted, the output of the second communication control apparatus is a recessive. However, since a signal level of a bus is a dominant, it is so assumed at this time that the second communication control apparatus fails in an arbitration. Thus, this second communication control apparatus stops to transmit the frame and the operation of this second communication control apparatus is transferred to a reception condition. As a result, the first communication control apparatus may win (succeed) the arbitration, and thus transmits the frame until last.
Thus, in the communication system operating under the CAN protocol, in the case that a plurality of frames are transmitted to a bus at the same time, a communication control apparatus which has transmitted a frame having an ID code whose logic value is the smallest (least) logic value may obtain a transmission right. Then, normally, such an ID code having a higher priority order is allocated to a frame to which a message required for quick response time has been allocated, and even when this frame collides with other frames, this frame may be transmitted with a priority.
On the other hand, in each of the communication apparatus, a plurality of mail boxes are provided. Each of these mail boxes is equipped with a message box used to store therein a message, which is superimposed with a frame so as to be transmitted. It should be understood that while box numbers are applied to the respective mail boxes, an ID code register, a use designation register and also a transmission request register are provided in each of the message boxes.
The ID code register is employed so as to store therein sorts of messages and identification (ID) codes indicative of priority orders of these messages stored in the message register. The use designation register is used to designate a use method (that is, use method of transmission/reception) of a message box. The transmission request register is employed so as to set a transmission request of such a message, which is stored in a transmission-purpose message box (FIG. 5).
Then, in the case that there is a message box which is designated for a reception purpose by a use designation register, a communication control apparatus receives such a frame, the ID code of which is made coincident with the ID code stored in the ID code register of this message box, and then, executes a reception control operation by which a message contained in the received frame is stored into the message register thereof.
On the other hand, in a case that there is a message box which is designated for a transmission purpose by a use designation register, a communication control apparatus executes a transmission control operation in such a manner that a frame is transmitted based upon a storage value (ID code and message) of a message box of a transmission request register, to which a transmission request has been set. It should be noted that when there are plural message boxes to which transmission requests have been set, a transmission control operation is carried out with respect to these message boxes in the order of small box number.
As a result, in the above communication control apparatus, when the number (frequency) of collisions of frames on a bus is increased, transmission waiting time of a message to which an ID code having a lower priority order has been allocated is prolonged. This message will be simply referred to as low-priority degree message. This calling manner may be similarly applied to high-priority degree message. As a result, such a message which has been stored in a message box having a larger box number (that is, transmissions priority order thereof is low) than that of the message box into which this low-priority degree message has been stored cannot be transmitted unless the transmission of the low-priority degree message stored in the message box whose box number is small (that is, transmission priority order is high) is ended, even when such an ID code having the highest priority order has been allocated to the first-mentioned message. There are some possibilities that the transmission of the high-priority degree message, which should be urgently transmitted, is largely delayed.
For example, as shown in FIG. 5, the following in-vehicle LAN for executing a communication control operation based upon the CAN protocol will now be considered, while this in-vehicle LAN is equipped with a sensor ECU 30, a control ECU 32 and an actuator ECU 34. This sensor ECU 30 produces a sensor signal from a detection signal of a sensor and transmits this produced sensor signal. The control ECU 32 produces actuator control signals A and B based upon the received sensor signal, and transmits these produced actuator control signals A and B. The actuator ECU 34 actuates actuators based on the actuator control signals A and B.
It should be noted that in the communication apparatus 32 of the control ECU, since the sensor signal corresponding to the message supplied from the sensor ECU is received, a use designation register of a message box having a box number of “0” is set for a reception purpose. An ID code (0100B) of a sensor signal to be received has been set in an ID code register of this message box. Also, in the communication control apparatus 34 of the actuator ECU, since the actuator control signals A and B corresponding to the message transmitted from the control ECU are received, use designation registers of message boxes having box numbers “0” and “1” are set to reception purposes. ID codes (0010B and 0011B) of the actuator control signals A and B to be received have been set to ID code registers of these message boxes. Thus, ID codes having higher priority degrees are allocated to the actuator control signals A and B, as compared with the sensor signal.
Then, it is so assumed that in the communication control apparatus 30 of the sensor ECU, after a transmission request of a sensor signal has been set to a message box having a box number of “0”, malfunction of the sensor is detected before this sensor signal is transmitted. Such a transmission request of a sensor malfunction signal is set to a message box having a box number of “1.” It should also be noted that an ID code (0000B) having a top priority degree has been allocated to the sensor malfunction signal in order that a transmission delay caused by losing of an arbitration on a bus does not occur.
Under such a condition, in the communication control apparatus 30 of the sensor ECU, since the transmission process operations are carried out in accordance with the box number sequence, unless the transmission of the sensor signal stored in the message box having the box number of “0” is ended, the sensor malfunction signal stored in the message box having the box number of “1” cannot be transmitted. Moreover, since the transmission request for the actuator control signals A and B having the ID code with the higher priority degree than that of the sensor signal is set to the communication control apparatus 32 of the control ECU, unless the transmissions of these actuator control signals are accomplished, the transmission of the sensor signal cannot be transmitted.
As a result, the transmission of the sensor malfunction signal is furthermore delayed. That is, as shown in FIG. 3B, the sensor malfunction signal, which should be immediately transmitted is transmitted at a final stage among these four signals, so that a large delay will be produced until this sensor malfunction signal reaches the control ECU. In FIGS. 3A and 3B, failure in the arbitration is shown with hatching.
Japanese Laid-open Patent Application No. HEI-1-143537 discloses a communication control apparatus. That is, in the CSMA/CD type communication system, when the above event happens to occur, this communication control apparatus rewrites the codes indicative of the priority degrees in such a manner that as to the message having long waiting time, the priority degree of this message becomes high on the bus.
However, even in this case, the transmission sequence of this message in the same communication control apparatus is not changed, unless the transmissions of all of such messages which have been produced in advance are accomplished. Therefore, the high-priority degree message which is produced later cannot be transmitted, so that the waiting time cannot be sufficiently shortened.
Also, in particular, in the CAN protocol in which identifying operations of messages and setting operations of priority degrees during arbitration are carried out by employing the same ID codes, when a priority degree (that is, ID code) is changed, a sort of message cannot be specified, but also a communication control apparatus provided on the reception side cannot receive this message. As a result, such a priority degree changing method cannot be applied to the communication system using the CAN protocol.